function(add_and_include_directories root_dir)
    # 当前路径是一个目录吗，是的话就加入到包含目录 #
    if (IS_DIRECTORY ${root_dir})
        # message("include dir: " ${root_dir})
        file(GLOB head ${dir}/*.h)
        include_directories(${root_dir})
        aux_source_directory(${root_dir} src_file)
        set(cmake_src_cache ${cmake_src_cache} ${src_file} ${head} CACHE STRING INTERNAL FORCE)
    endif()

    # 获得当前目录下的所有文件，让如ALL_SUB列表中 #
    file(GLOB ALL_SUB RELATIVE ${root_dir} ${root_dir}/*)
    foreach(sub ${ALL_SUB})
        if (IS_DIRECTORY ${root_dir}/${sub})
            # 对子目录递归调用，包含 #
            add_and_include_directories(${root_dir}/${sub})
        endif()
    endforeach()
endfunction()

function(Cmake_include_dir dir)
    # 当前路径是一个目录吗，是的话就加入到包含目录 #
    if (IS_DIRECTORY ${dir})
        include_directories(${dir})
    endif()

    # 获得当前目录下的所有文件，让如ALL_SUB列表中 #
    file(GLOB ALL_SUB RELATIVE ${dir} ${dir}/*)
    foreach(sub ${ALL_SUB})
        if (IS_DIRECTORY ${dir}/${sub})
            # 对子目录递归调用，包含 #
            Cmake_include_dir(${dir}/${sub})
        endif()
    endforeach()
endfunction()

function(Cmake_add_include_cache head)
    set(Com_cache_head ${Com_cache_head} ${head} CACHE STRING INTERNAL FORCE)
endfunction()

function(Cmake_add_lib_cache lib)
    set(Com_cache_lib ${Com_cache_lib} ${lib} CACHE STRING INTERNAL FORCE)
endfunction()
